import auto_main from "../../../data/autoUI/scene/auto_main";
import UIBase from "../UIBase";
import UIHelp, { DialogParams } from "../UIHelp";
import UINotice from "../notice/UINotice";



const { ccclass, menu, property } = cc._decorator;

@ccclass
@menu("UI/scene/UIMain")
export default class UIMain extends UIBase {
	ui: auto_main = null;

	protected static prefabUrl = "db://a";
	protected static className = "UIMain";

	onUILoad() {
		this.ui = this.node.addComponent(auto_main);
	}

	onShow() {
		this.onRegisterEvent(this.ui.btn_notice, this.onOpenNotice, this);
		this.onRegisterEvent(this.ui.btn_tip, this.onTip, this);
		this.onRegisterEvent(this.ui.btn_dialog, this.onDialog, this);
	}

	onHide() {
		this.unRegisterEvent(this.ui.btn_notice, this.onOpenNotice, this);
	}

	onStart() {

	}

	onOpenNotice() {
		UIHelp.ShowUI(UINotice);
	}

	onTip(){
		UIHelp.ShowTips("33333333");
	}

	onDialog(){
		let data = {
			title: "xx",
			content: "23232",
		};

		UIHelp.ShowDialog(data);
	}
}